package com.hytc.mymall.frgament;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hytc.mymall.R;
import com.hytc.mymall.adapter.MineAdapter;
import com.hytc.mymall.base.BaseFragment;
import com.hytc.mymall.bean.LoginBean;
import com.hytc.mymall.bean.MineInfoBean;
import com.hytc.mymall.braodcastreciver.HeadIconChangeReceiver;
import com.hytc.mymall.view.CircleImageView;
import com.hytc.mymall.view.LineGridView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


/**
 * Created by allkiss on 2016/12/9
 */

public class MineFragment extends BaseFragment implements AdapterView.OnItemClickListener, HeadIconChangeReceiver.HeadChangeInteraction {
    @BindView(R.id.iv_title_left)
    ImageView ivTitleLeft;
    @BindView(R.id.rl_back)
    RelativeLayout rlBack;
    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    @BindView(R.id.toolbar_title_arrow)
    ImageView toolbarTitleArrow;
    @BindView(R.id.rl_title)
    RelativeLayout rlTitle;
    @BindView(R.id.iv_mynews)
    ImageView ivMynews;
    @BindView(R.id.tv_info_commit)
    TextView tvInfoCommit;
    @BindView(R.id.rl_right)
    RelativeLayout rlRight;
    @BindView(R.id.iv_mine_headicon)
    CircleImageView ivMineHeadicon;
    @BindView(R.id.tv_mine_usertype)
    TextView tvMineUsertype;
    @BindView(R.id.tv_mine_id)
    TextView tvMineId;
    @BindView(R.id.tv_mine_name)
    TextView tvMineName;
    @BindView(R.id.ll_mine_head_bottom)
    LinearLayout llMineHeadBottom;
    @BindView(R.id.lv_mine)
    ListView lvMine;
    @BindView(R.id.iv_mine_below1)
    ImageView ivMineBelow1;
    @BindView(R.id.tv_mine_below1)
    TextView tvMineBelow1;
    @BindView(R.id.rl_mine_below1)
    RelativeLayout rlMineBelow1;
    @BindView(R.id.iv_mine_below2)
    ImageView ivMineBelow2;
    @BindView(R.id.tv_mine_below2)
    TextView tvMineBelow2;
    @BindView(R.id.rl_mine_below2)
    RelativeLayout rlMineBelow2;
    @BindView(R.id.iv_mine_below3)
    ImageView ivMineBelow3;
    @BindView(R.id.tv_mine_below3)
    TextView tvMineBelow3;
    @BindView(R.id.rl_mine_below3)
    RelativeLayout rlMineBelow3;
    @BindView(R.id.iv_mine_below4)
    ImageView ivMineBelow4;
    @BindView(R.id.tv_mine_below4)
    TextView tvMineBelow4;
    @BindView(R.id.rl_mine_below4)
    RelativeLayout rlMineBelow4;
    @BindView(R.id.iv_mine_below5)
    ImageView ivMineBelow5;
    @BindView(R.id.tv_mine_below5)
    TextView tvMineBelow5;
    @BindView(R.id.rl_mine_below5)
    RelativeLayout rlMineBelow5;
    @BindView(R.id.iv_mine_below6)
    ImageView ivMineBelow6;
    @BindView(R.id.tv_mine_below6)
    TextView tvMineBelow6;
    @BindView(R.id.rl_mine_below6)
    RelativeLayout rlMineBelow6;
    @BindView(R.id.gv_member_below)
    LineGridView gvMemberBelow;
    @BindView(R.id.rl_memberbelow_title)
    RelativeLayout rlMemberbelowTitle;
    @BindView(R.id.gv_member_below_gwyl)
    LineGridView gvMemberBelowGwyl;
    @BindView(R.id.ll_member_below)
    LinearLayout llMemberBelow;
    LoginBean loginBean;
    MineAdapter adapter;
    List<MineInfoBean> list=new ArrayList<>();
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    }

    @Override
    public void setHeadIcon(String p0) {

    }

    @Override
    public void setText() {

    }

    @Override
    public void setUsername(String p0) {

    }

    @Override
    public View onCreateView(final LayoutInflater layoutInflater, final ViewGroup viewGroup, final Bundle bundle) {
        View view = layoutInflater.inflate(R.layout.fragment_mine, null);
        ButterKnife.bind(this, view);
        initView();
        return view;
    }

    private void initView() {
        rlBack.setVisibility(View.VISIBLE);
        ivTitleLeft.setImageResource(R.drawable.mine_title_setting);
        rlRight.setVisibility(View.VISIBLE);
        switch (1){
            case 1:
                setMessenger();
                break;
            case 2:
                setMerchants();
                break;
            case 3:
                setService();
                break;
        }
    }

    /**
     * 初始化服务商
     */
    private void setService() {
        setListV();
        ivMineBelow1.setImageResource(R.drawable.mine_sjyye);
        tvMineBelow1.setText("我的信使都");
    }

    /**
     * 初始化零售商家
     */
    private void setMerchants() {
        setListV();
        ivMineBelow1.setImageResource(R.drawable.mine_wdxxd);
        tvMineBelow1.setText("我的信使都");
        ivMineBelow2.setImageResource(R.drawable.mine_rljz);
        tvMineBelow2.setText("让利捐钱");
    }

    /**
     * 初始化信使
     */
    private void setMessenger() {
        setListV();
    }

    private void setListV(){
        list.clear();
        list.add(new MineInfoBean("爱心总数","220"));
        list.add(new MineInfoBean("爱心总数","220"));
        list.add(new MineInfoBean("爱心总数","220"));
        list.add(new MineInfoBean("爱心总数","220"));
        list.add(new MineInfoBean("爱心总数","220"));//以上未初始化测试数据
        adapter=new MineAdapter(getActivity(),list);
        lvMine.setAdapter(adapter);
        adapter.notifyDataSetChanged();
    }

    @OnClick({R.id.rl_back, R.id.rl_right, R.id.iv_mine_headicon, R.id.rl_mine_below1, R.id.rl_mine_below2, R.id.rl_mine_below3, R.id.rl_mine_below4, R.id.rl_mine_below5, R.id.rl_mine_below6})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rl_back:
                break;
            case R.id.rl_right:
                break;
            case R.id.iv_mine_headicon:
                break;
            case R.id.rl_mine_below1:
                break;
            case R.id.rl_mine_below2:
                break;
            case R.id.rl_mine_below3:
//                intent = new Intent(getActivity(), ZhiJuanActivity.class);
                break;
            case R.id.rl_mine_below4:
//                intent = new Intent(getActivity(), ZhiJuanActivity.class);
                break;
            case R.id.rl_mine_below5:
//                intent = new Intent(getActivity(), ZhiJuanActivity.class);
                break;
            case R.id.rl_mine_below6:
//                intent = new Intent(getActivity(), ZhiJuanActivity.class);
                break;
        }
    }

    @Override
    public void initView(View p0) {

    }


    //    private MineAdapter adapter;
//    private List<MineInfoBean> datas;
//    private SharedPreferences.Editor editor;
//    private LineGridView gwyl;
//    private ImageView iv1;
//    private ImageView iv2;
//    private ImageView iv3;
//    private ImageView iv4;
//    private ImageView iv5;
//    private ImageView iv6;
//    private LineGridView lgv;
//    public LinearLayout ll_member_below;
//    public LoginBean.Data_Login loginBean;
//    private int loginstly;
//    private ListView lv;
//    private CircleImageView personalInfo;
//    private ProgressDialog progressDialog;
//    private HeadIconChangeReceiver receiver;
//    private RelativeLayout rl1;
//    private RelativeLayout rl2;
//    private RelativeLayout rl3;
//    private RelativeLayout rl4;
//    private RelativeLayout rl5;
//    private RelativeLayout rl6;
//    private SharedPreferences sp_token;
//    private TextView tv1;
//    private TextView tv2;
//    private TextView tv3;
//    private TextView tv4;
//    private TextView tv5;
//    private TextView tv6;
//    private TextView tv_id;
//    private TextView tv_title;
//    private TextView tv_username;
//    private TextView tv_usertype;
//
//    public MineFragment() {
//        this.datas = null;
//    }
//
//    static /* synthetic */ void access$2(final MineFragment mineFragment, final List datas) {
//        mineFragment.datas = (List<MineInfoBean>)datas;
//    }
//
//    private List<MineInfoBean> getData() {
//        final ArrayList<MineInfoBean> list = new ArrayList<MineInfoBean>();
//        MineInfoBean mineInfoBean;
//        if (this.loginstly == 1 || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//            mineInfoBean = new MineInfoBean(this.getResources().getString(2131362108), new StringBuilder(String.valueOf(this.loginBean.heatamount)).toString());
//        }
//        else if (this.loginstly == 2 || this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//            mineInfoBean = new MineInfoBean(this.getResources().getString(2131362054), this.loginBean.resetmoney);
//        }
//        else {
//            final int loginstly = this.loginstly;
//            mineInfoBean = null;
//            if (loginstly == 3) {
//                mineInfoBean = new MineInfoBean(this.getResources().getString(2131362070), new StringBuilder(String.valueOf(this.loginBean.mercount)).toString());
//            }
//        }
//        final MineInfoBean mineInfoBean2 = new MineInfoBean(this.getResources().getString(2131362110), new StringBuilder(String.valueOf(this.loginBean.couriercount)).toString());
//        String s;
//        if (this.loginstly == 1 || (this.loginstly == 3 && this.loginBean.ispersonal.equals("1")) || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//            s = this.getResources().getString(2131362112);
//        }
//        else {
//            s = this.getResources().getString(2131362113);
//        }
//        final MineInfoBean mineInfoBean3 = new MineInfoBean(s, new StringBuilder(String.valueOf(this.loginBean.nopaycount)).toString());
//        final MineInfoBean mineInfoBean4 = new MineInfoBean(this.getResources().getString(2131362114), BaseTools.formatDouble(this.loginBean.yesterdayamount + this.loginBean.yesterdayamountgy));
//        list.add(mineInfoBean);
//        list.add(mineInfoBean2);
//        if (this.loginstly == 1 || this.loginstly == 2 || this.loginstly == 3 || this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//            list.add(mineInfoBean3);
//        }
//        list.add(new MineInfoBean(this.getResources().getString(2131362116), new StringBuilder(String.valueOf(this.loginBean.ineffectiveRewardBean)).toString()));
//        list.add(mineInfoBean4);
//        return list;
//    }
//
//    private void getUserInfo() {
//        http.OkHttpClientManager.getAsyn("http://www.51ydgy.com/appcommon/getmessage?token=" + ActivityManager.loginBean.auth.aukeyValue + "&channelId=" + ActivityManager.CHANNELID + "&deviceType=1", new http.StringPopCallBack(this.getActivity(), false) {
//            @Override
//            public void onResponse(final String s) {
//                try {
//                    final LoginBean loginBean = GsonUtils.json2Bean(s, LoginBean.class);
//                    if (loginBean != null && loginBean.code.equals("0")) {
//                        final LoginBean.Data_Login data = loginBean.data;
//                        if (data != null) {
//                            ActivityManager.loginBean = data;
//                            final String encode = URLEncoder.encode(loginBean.data.auth.aukeyValue, "UTF-8");
//                            ActivityManager.loginBean.auth.aukeyValue = encode;
//                            MineFragment.this.editor.putString("token", encode).commit();
//                            MineFragment.this.loginBean = data;
//                            MineFragment.access$2(MineFragment.this, null);
//                            MineFragment.this.adapter.list = MineFragment.this.getData();
//                            MineFragment.this.adapter.notifyDataSetChanged();
//                        }
//                    }
//                }
//                catch (Exception ex) {
//                    ex.printStackTrace();
//                }
//            }
//        });
//    }
//
//    private void initData() {
//        this.loginBean = ActivityManager.loginBean;
//        final String username = this.loginBean.username;
//        final String usernumber = this.loginBean.usernumber;
//        this.loginstly = this.loginBean.usertype;
//        this.updateAPP(this.loginBean.adroid_version);
//        this.initViewWithLoginStyle();
//        Glide.with(this).load(new StringBuilder().append(this.loginBean.picture).toString()).error(2130837638).into((ImageView)this.personalInfo);
//        this.datas = this.getData();
//        this.adapter = new MineAdapter((Context)this.getActivity(), this.datas);
//        this.lv.setAdapter((ListAdapter)this.adapter);
//        String text = "";
//        if (this.loginstly == 1) {
//            text = "\u4fe1\u4f7f";
//        }
//        else if (this.loginstly == 2) {
//            text = "\u5546\u5bb6";
//        }
//        else if (this.loginstly == 3) {
//            text = "\u670d\u52a1\u5546";
//        }
//        else if (this.loginstly == 24) {
//            text = "\u5236\u9020\u5546\u4fe1\u4f7f";
//        }
//        else if (this.loginstly == 25) {
//            text = "\u8d38\u6613\u5546\u4fe1\u4f7f";
//        }
//        else if (this.loginstly == 26) {
//            text = "\u96f6\u552e\u5546\u4fe1\u4f7f";
//        }
//        else if (this.loginstly == 27) {
//            text = "\u5236\u9020\u5546";
//        }
//        else if (this.loginstly == 28) {
//            text = "\u8d38\u6613\u5546";
//        }
//        else if (this.loginstly == 29) {
//            text = "\u96f6\u552e\u5546";
//        }
//        this.tv_usertype.setText((CharSequence)text);
//        if (!TextUtils.isEmpty((CharSequence)username)) {
//            this.tv_username.setText((CharSequence)username);
//        }
//        if (!TextUtils.isEmpty((CharSequence)usernumber)) {
//            this.tv_id.setText((CharSequence)("ID:" + usernumber));
//        }
//    }
//
//    private void initMemberBelow() {
//        this.ll_member_below.setVisibility(View.VISIBLE);
//        final ArrayList<MemberItemBean> list = new ArrayList<MemberItemBean>();
//        list.add(new MemberItemBean(2130837722, this.getResources().getString(2131361874)));
//        list.add(new MemberItemBean(2130837723, this.getResources().getString(2131361875)));
//        list.add(new MemberItemBean(2130837727, this.getResources().getString(2131361878)));
//        list.add(new MemberItemBean(2130837711, this.getResources().getString(2131361881)));
//        list.add(new MemberItemBean(2130837730, this.getResources().getString(2131361895)));
//        list.add(new MemberItemBean(2130837724, this.getResources().getString(2131361898)));
//        final ArrayList<MemberItemBean> list2 = new ArrayList<MemberItemBean>();
//        list2.add(new MemberItemBean(2130837725, this.getResources().getString(2131361899)));
//        list2.add(new MemberItemBean(2130837726, this.getResources().getString(2131361900)));
//        list2.add(new MemberItemBean(2130837712, this.getResources().getString(2131361901)));
//        this.lgv.setAdapter((ListAdapter)new MemberBelowAdapter((Context)this.getActivity(), list));
//        this.gwyl.setAdapter((ListAdapter)new MemberBelowAdapter((Context)this.getActivity(), list2));
//        this.lgv.setOnItemClickListener((AdapterView.OnItemClickListener)this);
//        this.gwyl.setOnItemClickListener(this);
//    }
//
//    private void initView(final View view) {
//        final RelativeLayout relativeLayout = (RelativeLayout)view.findViewById(2131100408);
//        final ImageView imageView = (ImageView)view.findViewById(2131100409);
//        this.tv_title = (TextView)view.findViewById(2131100411);
//        final RelativeLayout relativeLayout2 = (RelativeLayout)view.findViewById(2131100413);
//        this.lv = (ListView)view.findViewById(2131100089);
//        this.personalInfo = (CircleImageView)view.findViewById(2131100085);
//        this.tv_usertype = (TextView)view.findViewById(2131100086);
//        this.tv_username = (TextView)view.findViewById(2131100088);
//        this.tv_id = (TextView)view.findViewById(2131100087);
//        this.rl1 = (RelativeLayout)view.findViewById(2131100325);
//        this.rl2 = (RelativeLayout)view.findViewById(2131100328);
//        this.rl3 = (RelativeLayout)view.findViewById(2131100331);
//        this.rl4 = (RelativeLayout)view.findViewById(2131100334);
//        this.rl5 = (RelativeLayout)view.findViewById(2131100337);
//        this.rl6 = (RelativeLayout)view.findViewById(2131100340);
//        this.iv1 = (ImageView)view.findViewById(2131100326);
//        this.iv2 = (ImageView)view.findViewById(2131100329);
//        this.iv3 = (ImageView)view.findViewById(2131100332);
//        this.iv4 = (ImageView)view.findViewById(2131100335);
//        this.iv5 = (ImageView)view.findViewById(2131100338);
//        this.iv6 = (ImageView)view.findViewById(2131100341);
//        this.tv1 = (TextView)view.findViewById(2131100327);
//        this.tv2 = (TextView)view.findViewById(2131100330);
//        this.tv3 = (TextView)view.findViewById(2131100333);
//        this.tv4 = (TextView)view.findViewById(2131100336);
//        this.tv5 = (TextView)view.findViewById(2131100339);
//        this.tv6 = (TextView)view.findViewById(2131100342);
//        this.ll_member_below = (LinearLayout)view.findViewById(2131100322);
//        this.lgv = (LineGridView)view.findViewById(2131100323);
//        this.gwyl = (LineGridView)view.findViewById(2131100324);
//        relativeLayout.setVisibility(View.VISIBLE);
//        imageView.setImageResource(2130837718);
//        this.tv_title.setText((CharSequence)this.getResources().getString(2131361873));
//        relativeLayout2.setVisibility(View.VISIBLE);
//        relativeLayout.setOnClickListener(this);
//        relativeLayout2.setOnClickListener(this);
//        this.personalInfo.setOnClickListener(this);
//        this.rl1.setOnClickListener(this);
//        this.rl2.setOnClickListener(this);
//        this.rl3.setOnClickListener(this);
//        this.rl4.setOnClickListener(this);
//        this.rl5.setOnClickListener(this);
//        this.rl6.setOnClickListener(this);
//        this.lv.setOnItemClickListener((AdapterView.OnItemClickListener)this);
//    }
//
//    private void initViewWithLoginStyle() {
//        int imageResource = 0;
//        CharSequence text = null;
//        int imageResource2;
//        int imageResource3;
//        String text2;
//        String text3;
//        if (this.loginstly == 1 || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//            imageResource2 = 2130837722;
//            imageResource3 = 2130837723;
//            text2 = this.getResourceName(2131361874);
//            text3 = this.getResourceName(2131361875);
//        }
//        else if (this.loginstly == 2 || this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//            imageResource2 = 2130837723;
//            imageResource3 = 2130837714;
//            text2 = this.getResourceName(2131361875);
//            text3 = this.getResourceName(2131361876);
//        }
//        else {
//            final int loginstly = this.loginstly;
//            imageResource2 = 0;
//            imageResource3 = 0;
//            text2 = null;
//            text3 = null;
//            if (loginstly == 3) {
//                imageResource2 = 2130837717;
//                imageResource3 = 2130837723;
//                text2 = this.getResourceName(2131361877);
//                text3 = this.getResourceName(2131361875);
//            }
//        }
//        int imageResource4;
//        int imageResource5;
//        int imageResource6;
//        String text4;
//        String text5;
//        String text6;
//        if (this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//            imageResource4 = 2130837727;
//            imageResource5 = 2130837711;
//            imageResource6 = 2130837730;
//            text4 = this.getResourceName(2131361878);
//            text5 = this.getResourceName(2131361881);
//            text6 = this.getResourceName(2131361895);
//            this.rl6.setVisibility(View.INVISIBLE);
//        }
//        else if (this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//            imageResource4 = 2130837727;
//            imageResource5 = 2130837711;
//            imageResource6 = 2130837730;
//            imageResource = 2130837724;
//            text4 = this.getResourceName(2131361878);
//            text5 = this.getResourceName(2131361881);
//            text6 = this.getResourceName(2131361895);
//            text = this.getResourceName(2131361898);
//        }
//        else {
//            imageResource4 = 2130837727;
//            imageResource5 = 2130837711;
//            imageResource = 2130837724;
//            text4 = this.getResourceName(2131361878);
//            text5 = this.getResourceName(2131361881);
//            text = this.getResourceName(2131361898);
//            if (this.loginstly == 2) {
//                imageResource6 = 2130837730;
//                text6 = this.getResourceName(2131361895);
//            }
//            else {
//                imageResource6 = 2130837730;
//                text6 = this.getResourceName(2131361895);
//            }
//        }
//        this.iv1.setImageResource(imageResource2);
//        this.iv2.setImageResource(imageResource3);
//        this.iv3.setImageResource(imageResource4);
//        this.iv4.setImageResource(imageResource5);
//        this.iv5.setImageResource(imageResource6);
//        this.iv6.setImageResource(imageResource);
//        this.tv1.setText((CharSequence)text2);
//        this.tv2.setText((CharSequence)text3);
//        this.tv3.setText((CharSequence)text4);
//        this.tv4.setText((CharSequence)text5);
//        this.tv5.setText((CharSequence)text6);
//        this.tv6.setText(text);
//    }
//
//    public String getResourceName(final int n) {
//        return this.getResources().getString(n);
//    }
//
//    public void onClick(final View view) {
//        final int id = view.getId();
//        Intent intent = null;
//        switch (id) {
//            case 2131100408: {
//                intent = new Intent((Context)this.getActivity(), (Class)SettingActivity.class);
//                break;
//            }
//            case 2131100413: {
//                intent = new Intent((Context)this.getActivity(), (Class)MyNewsActivity.class);
//                break;
//            }
//            case 2131100085: {
//                if (this.loginstly == 1 || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MyInfoActivity.class);
//                    break;
//                }
//                if (this.loginstly == 2 || this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MerchantInfoActivity.class);
//                    break;
//                }
//                final int loginstly = this.loginstly;
//                intent = null;
//                if (loginstly == 3) {
//                    intent = new Intent((Context)this.getActivity(), (Class)AgentInfoActivity.class);
//                    break;
//                }
//                break;
//            }
//            case 2131100325: {
//                if (this.loginstly == 1 || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MyLoveActivity.class);
//                    break;
//                }
//                if (this.loginstly == 2 || this.loginstly == 27 || this.loginstly == 28 || this.loginstly == 29) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MyBeansActivity.class);
//                    break;
//                }
//                final int loginstly2 = this.loginstly;
//                intent = null;
//                if (loginstly2 == 3) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MerchantTurnoverActivity.class);
//                    break;
//                }
//                break;
//            }
//            case 2131100328: {
//                if (this.loginstly == 1 || this.loginstly == 3 || this.loginstly == 24 || this.loginstly == 25 || this.loginstly == 26) {
//                    intent = new Intent((Context)this.getActivity(), (Class)MyBeansActivity.class);
//                    break;
//                }
//                if (this.loginstly != 2 && this.loginstly != 27 && this.loginstly != 28) {
//                    final int loginstly3 = this.loginstly;
//                    intent = null;
//                    if (loginstly3 != 29) {
//                        break;
//                    }
//                }
//                intent = new Intent((Context)this.getActivity(), (Class)ConcessionsDonationActivity.class);
//                break;
//            }
//            case 2131100331: {
//                intent = new Intent((Context)this.getActivity(), (Class)ZhiJuanActivity.class);
//                break;
//            }
//            case 2131100334: {
//                intent = new Intent((Context)this.getActivity(), (Class)HuiGouActivity.class);
//                break;
//            }
//            case 2131100337: {
//                intent = new Intent((Context)this.getActivity(), (Class)ZhuanZengActivity.class);
//                break;
//            }
//            case 2131100340: {
//                intent = new Intent((Context)this.getActivity(), (Class)MyRecommendActivity.class);
//                break;
//            }
//        }
//        this.startActivity(intent);
//    }
//
//
//    @Override
//    public void onDestroy() {
//        super.onDestroy();
//        this.getActivity().unregisterReceiver((BroadcastReceiver)this.receiver);
//    }
//
//    public void onItemClick(final AdapterView<?> adapterView, final View view, final int n, final long n2) {
//        switch (adapterView.getId()) {
//            case 2131100089: {
//                if (n != -1 + this.datas.size()) {
//                    break;
//                }
//                if (this.loginstly == 2 || this.loginstly == 3) {
//                    this.startActivity(new Intent((Context)this.getActivity(), (Class)AgentRewardActivity.class));
//                    return;
//                }
//                final Intent intent = new Intent((Context)this.getActivity(), (Class)RewardActivity.class);
//                intent.putExtra("loginstly", this.loginstly);
//                this.startActivity(intent);
//            }
//            case 2131100323: {
//                Intent intent2;
//                if (n == 0) {
//                    intent2 = new Intent((Context)this.getActivity(), (Class)MyLoveActivity.class);
//                }
//                else if (n == 1) {
//                    intent2 = new Intent((Context)this.getActivity(), (Class)MyBeansActivity.class);
//                }
//                else if (n == 2) {
//                    intent2 = new Intent((Context)this.getActivity(), (Class)ZhiJuanActivity.class);
//                }
//                else if (n == 3) {
//                    intent2 = new Intent((Context)this.getActivity(), (Class)HuiGouActivity.class);
//                }
//                else if (n == 4) {
//                    intent2 = new Intent((Context)this.getActivity(), (Class)ZhuanZengActivity.class);
//                }
//                else {
//                    intent2 = null;
//                    if (n == 5) {
//                        intent2 = new Intent((Context)this.getActivity(), (Class)MyRecommendActivity.class);
//                    }
//                }
//                this.startActivity(intent2);
//            }
//            case 2131100324: {
//                if (n != 0 && n != 1) {
//                    return;
//                }
//                break;
//            }
//        }
//    }
//
//    @Override
//    public void onResume() {
//        super.onResume();
//        this.tv_username.setText((CharSequence)ActivityManager.loginBean.username);
//    }
//
//    @Override
//    public void onViewCreated(final View view, final Bundle bundle) {
//        super.onViewCreated(view, bundle);
//        this.initView(view);
//        this.initData();
//        final FragmentActivity activity = this.getActivity();
//        this.getActivity();
//        this.sp_token = activity.getSharedPreferences("token", 0);
//        this.editor = this.sp_token.edit();
//        final IntentFilter intentFilter = new IntentFilter();
//        this.receiver = new HeadIconChangeReceiver();
//        intentFilter.addAction("com.sz.ydgy.headicon.change");
//        intentFilter.addAction("com.sz.ydgy.xsd.changes");
//        this.getActivity().registerReceiver((BroadcastReceiver)this.receiver, intentFilter);
//        this.receiver.setHeadIconListener((HeadIconChangeReceiver.HeadChangeInteraction)this);
//    }
//
//    public void setHeadIcon(final String s) {
//        Glide.with(this.getActivity()).load(new StringBuilder().append(s).toString()).error(2130837638).into((ImageView)this.personalInfo);
//    }
//
//    public void setText() {
//        this.getUserInfo();
//    }
//
//    public void setUsername(final String text) {
//        this.tv_username.setText((CharSequence)text);
//    }
//
//    public void updateAPP(final String s) {
//        if (!BaseTools.getVersion((Context)this.getActivity()).equals(s)) {
//            (this.progressDialog = new ProgressDialog((Context)this.getActivity())).setTitle((CharSequence)"\u6b63\u5728\u4e0b\u8f7d...");
//            this.progressDialog.setCanceledOnTouchOutside(false);
//            this.progressDialog.setProgressStyle(1);
//            final AlertDialog.Builder alertDialog$Builder = new AlertDialog.Builder((Context)this.getActivity());
//            alertDialog$Builder.setMessage((CharSequence)"\u4e00\u70b9\u516c\u76ca\u53c8\u6709\u65b0\u7248\u672c\u4e0a\u7ebf\u4e86\uff0c\u6293\u7d27\u65f6\u95f4\u66f4\u65b0\u54df\uff01");
//            alertDialog$Builder.setTitle((CharSequence)"\u63d0\u793a");
//            alertDialog$Builder.setPositiveButton((CharSequence)"\u786e\u8ba4", (DialogInterface.OnClickListener)new DialogInterface.OnClickListener() {
//                public void onClick(final DialogInterface dialogInterface, final int n) {
//                    dialogInterface.dismiss();
//                    ToastUtils.showToast((Context)MineFragment.this.getActivity(), "\u5f00\u59cb\u66f4\u65b0\u5e94\u7528", true);
//                    final File file = new File(String.valueOf(ActivityManager.HEAD_DIR) + "ydgy.apk");
//                    if (file.exists()) {
//                        file.delete();
//                    }
//                    new DownloadAsyncTask((Context)MineFragment.this.getActivity(), ActivityManager.loginBean.downloadUrl, MineFragment.this.progressDialog).execute((Object[])new String[0]);
//                }
//            });
//            alertDialog$Builder.setNegativeButton((CharSequence)"\u53d6\u6d88", (DialogInterface.OnClickListener)new DialogInterface.OnClickListener() {
//                public void onClick(final DialogInterface dialogInterface, final int n) {
//                    dialogInterface.dismiss();
//                }
//            });
//            alertDialog$Builder.create().show();
//        }
//    }
}
